class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: C = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

k = A("k")
a = B("a")
n = C("n")
h = B("h")
j = B("j")
i = A("i")

k.q = i
k.u = i
k.x = h
a.y = j
a.t = n
a.o = n
n.o = j
h.y = j
h.t = n
h.o = n
j.y = a
j.t = n
j.o = n
i.q = k
i.u = k
i.x = a
assert h.o.o.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: C = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

k = A("k")
a = B("a")
n = C("n")
h = B("h")
j = B("j")
i = A("i")

k.q = i
k.u = i
k.x = h
a.y = j
a.t = n
a.o = n
n.o = j
h.y = j
h.t = n
h.o = n
j.y = a
j.t = n
j.o = n
i.q = k
i.u = k
i.x = a
assert h.o.o.y.y.y.txt == "a"