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

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.s: C = None
        self.txt = txt

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

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

j = A("j")
k = B("k")
c = C("c")
a = D("a")
g = E("g")
b = B("b")
l = C("l")
e = E("e")

j.u = k
k.p = b
k.t = b
c.t = k
c.r = l
c.s = l
a.v = g
a.r = j
g.q = b
b.p = k
b.t = k
l.t = k
l.r = c
l.s = c
e.q = b
assert e.q.p.t.t.p.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.s: C = None
        self.txt = txt

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

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

j = A("j")
k = B("k")
c = C("c")
a = D("a")
g = E("g")
b = B("b")
l = C("l")
e = E("e")

j.u = k
k.p = b
k.t = b
c.t = k
c.r = l
c.s = l
a.v = g
a.r = j
g.q = b
b.p = k
b.t = k
l.t = k
l.r = c
l.s = c
e.q = b
assert e.q.p.t.t.p.t.p.txt == "b"