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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: C = None
        self.v: A = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: E = None
        self.o: C = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: F = None
        self.y: B = None
        self.w: A = None
        self.txt = txt

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

m = A("m")
l = B("l")
d = C("d")
e = D("e")
a = E("a")
i = F("i")
f = E("f")
c = A("c")
j = F("j")

m.t = d
l.s = d
l.p = d
l.q = d
l.v = m
l.t = a
d.p = c
e.u = f
e.p = a
e.o = d
e.r = l
a.u = e
a.t = i
a.y = l
a.w = m
i.q = j
f.u = e
f.t = j
f.y = l
f.w = m
c.t = d
j.q = i
assert e.u.t.q.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: C = None
        self.v: A = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: E = None
        self.o: C = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: F = None
        self.y: B = None
        self.w: A = None
        self.txt = txt

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

m = A("m")
l = B("l")
d = C("d")
e = D("e")
a = E("a")
i = F("i")
f = E("f")
c = A("c")
j = F("j")

m.t = d
l.s = d
l.p = d
l.q = d
l.v = m
l.t = a
d.p = c
e.u = f
e.p = a
e.o = d
e.r = l
a.u = e
a.t = i
a.y = l
a.w = m
i.q = j
f.u = e
f.t = j
f.y = l
f.w = m
c.t = d
j.q = i
assert e.u.t.q.q.q.q.q.txt == "i"