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

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

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

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

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

g = A("g")
k = B("k")
a = C("a")
e = D("e")
i = E("i")
b = C("b")
h = E("h")
l = E("l")

g.p = b
k.z = l
k.q = a
a.u = g
e.o = g
i.q = g
i.y = l
i.z = a
i.t = k
b.u = g
h.q = g
h.y = l
h.z = a
h.t = k
l.q = g
l.y = i
l.z = b
l.t = k
assert l.t.q.u.p.u.p.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

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

g = A("g")
k = B("k")
a = C("a")
e = D("e")
i = E("i")
b = C("b")
h = E("h")
l = E("l")

g.p = b
k.z = l
k.q = a
a.u = g
e.o = g
i.q = g
i.y = l
i.z = a
i.t = k
b.u = g
h.q = g
h.y = l
h.z = a
h.t = k
l.q = g
l.y = i
l.z = b
l.t = k
assert l.t.q.u.p.u.p.u.p.txt == "b"