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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: D = None
        self.u: D = None
        self.z: D = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

l.u = j
l.q = h
d.q = j
d.w = j
d.r = c
d.u = h
d.z = h
a.y = l
a.t = d
a.u = d
a.p = j
h.t = l
j.t = c
f.o = h
f.y = l
f.u = l
c.t = l
g.t = h
i.o = h
i.y = l
i.u = l
assert i.y.u.t.t.u.t.t.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: D = None
        self.u: D = None
        self.z: D = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

l.u = j
l.q = h
d.q = j
d.w = j
d.r = c
d.u = h
d.z = h
a.y = l
a.t = d
a.u = d
a.p = j
h.t = l
j.t = c
f.o = h
f.y = l
f.u = l
c.t = l
g.t = h
i.o = h
i.y = l
i.u = l
assert i.y.u.t.t.u.t.t.u.t.txt == "c"