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

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

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

b = A("b")
i = B("i")
m = C("m")
k = C("k")
j = C("j")
f = A("f")
d = C("d")
c = C("c")

b.y = f
b.t = i
i.o = b
i.u = f
m.q = i
m.r = i
k.q = i
k.r = i
j.q = i
j.r = i
f.y = b
f.t = i
d.q = i
d.r = i
c.q = i
c.r = i
assert d.q.u.t.u.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: B = None
        self.txt = txt

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

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

b = A("b")
i = B("i")
m = C("m")
k = C("k")
j = C("j")
f = A("f")
d = C("d")
c = C("c")

b.y = f
b.t = i
i.o = b
i.u = f
m.q = i
m.r = i
k.q = i
k.r = i
j.q = i
j.r = i
f.y = b
f.t = i
d.q = i
d.r = i
c.q = i
c.r = i
assert d.q.u.t.u.y.t.txt == "i"