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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: A = None
        self.txt = txt

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

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

l = A("l")
a = B("a")
f = C("f")
i = D("i")
g = E("g")
d = A("d")
c = B("c")
e = A("e")
n = B("n")

l.t = i
l.x = i
a.u = n
a.o = i
f.v = i
f.o = d
i.q = a
g.z = d
g.o = n
d.t = i
d.x = i
c.u = a
c.o = i
e.t = i
e.x = i
n.u = c
n.o = i
assert e.x.q.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: A = None
        self.txt = txt

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

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

l = A("l")
a = B("a")
f = C("f")
i = D("i")
g = E("g")
d = A("d")
c = B("c")
e = A("e")
n = B("n")

l.t = i
l.x = i
a.u = n
a.o = i
f.v = i
f.o = d
i.q = a
g.z = d
g.o = n
d.t = i
d.x = i
c.u = a
c.o = i
e.t = i
e.x = i
n.u = c
n.o = i
assert e.x.q.u.u.txt == "c"