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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: D = None
        self.r: A = None
        self.w: E = None
        self.txt = txt

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

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

b = A("b")
a = B("a")
e = C("e")
g = D("g")
h = E("h")
j = D("j")
k = E("k")
m = A("m")

b.t = m
b.p = k
a.t = b
a.p = e
a.v = h
e.x = j
e.z = g
e.r = m
e.w = k
g.r = e
g.o = e
g.s = m
h.v = k
h.u = a
j.r = e
j.o = e
j.s = m
k.v = h
k.u = a
m.t = b
m.p = h
assert j.s.p.v.u.t.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: D = None
        self.r: A = None
        self.w: E = None
        self.txt = txt

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

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

b = A("b")
a = B("a")
e = C("e")
g = D("g")
h = E("h")
j = D("j")
k = E("k")
m = A("m")

b.t = m
b.p = k
a.t = b
a.p = e
a.v = h
e.x = j
e.z = g
e.r = m
e.w = k
g.r = e
g.o = e
g.s = m
h.v = k
h.u = a
j.r = e
j.o = e
j.s = m
k.v = h
k.u = a
m.t = b
m.p = h
assert j.s.p.v.u.t.t.p.txt == "h"