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

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

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

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

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

a = A("a")
f = B("f")
b = C("b")
l = D("l")
k = E("k")
i = E("i")
d = C("d")
e = A("e")

a.t = k
a.p = k
a.v = l
a.s = l
a.x = f
f.x = k
f.v = b
f.q = i
b.x = f
l.x = i
k.u = l
k.x = i
i.u = l
i.x = k
d.x = f
e.t = k
e.v = l
e.s = l
e.p = i
e.x = f
assert f.q.x.u.x.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: D = None
        self.p: E = None
        self.x: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

a = A("a")
f = B("f")
b = C("b")
l = D("l")
k = E("k")
i = E("i")
d = C("d")
e = A("e")

a.t = k
a.p = k
a.v = l
a.s = l
a.x = f
f.x = k
f.v = b
f.q = i
b.x = f
l.x = i
k.u = l
k.x = i
i.u = l
i.x = k
d.x = f
e.t = k
e.v = l
e.s = l
e.p = i
e.x = f
assert f.q.x.u.x.u.x.txt == "i"