#include <iostream>
#include <string>
class Buffer {
private:
int id;
public:
Buffer(int i) : id(i) {}
Buffer& operator=(const Buffer& other) {
if(this == &other){
std::cout << "Self-Assignment Detected" << std::endl;
return *this;
}
this->id = other.id;
std::cout << "Assignment Complete" << std::endl;
return *this;
}
void log() {
std::cout << "Buffer ID: " << id << std::endl;
}
};
int main() {
int N;
if (!(std::cin >> N)) return 0;
for (int i = 0; i < N; ++i) {
std::string cmd;
std::cin >> cmd;
if (cmd == "ASSIGN") {
int i1, i2;
std::cin >> i1 >> i2;
Buffer b1(i1);
Buffer b2(i2);
b1 = b2;
b1.log();
} else if (cmd == "SELF") {
int i1;
std::cin >> i1;
Buffer b1(i1);
b1 = b1; // Self-assignment
b1.log();
}
}
return 0;
}