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

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

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

k = A("k")
l = B("l")
i = C("i")
e = C("e")
b = B("b")
a = C("a")
c = A("c")
d = C("d")
j = B("j")
f = C("f")

k.o = b
k.y = l
l.w = c
l.v = b
l.y = e
i.t = d
i.q = e
e.t = i
e.q = a
b.w = c
b.v = l
b.y = e
a.t = i
a.q = e
c.o = l
c.y = j
d.t = a
d.q = i
j.w = k
j.v = b
j.y = e
f.t = i
f.q = d
assert a.t.t.t.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: B = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
i = C("i")
e = C("e")
b = B("b")
a = C("a")
c = A("c")
d = C("d")
j = B("j")
f = C("f")

k.o = b
k.y = l
l.w = c
l.v = b
l.y = e
i.t = d
i.q = e
e.t = i
e.q = a
b.w = c
b.v = l
b.y = e
a.t = i
a.q = e
c.o = l
c.y = j
d.t = a
d.q = i
j.w = k
j.v = b
j.y = e
f.t = i
f.q = d
assert a.t.t.t.q.q.q.txt == "e"