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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: C = None
        self.w: E = None
        self.s: E = None
        self.p: A = None
        self.txt = txt

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

k.y = j
k.o = h
j.x = c
j.p = l
d.r = g
d.t = a
d.o = j
a.p = d
a.r = k
g.z = a
g.o = d
g.w = l
g.s = l
g.p = h
l.z = a
l.o = m
l.w = g
l.s = g
l.p = k
m.r = g
m.t = e
m.o = j
c.x = j
c.p = l
e.p = m
e.r = k
h.y = j
h.o = k
assert h.y.p.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: C = None
        self.w: E = None
        self.s: E = None
        self.p: A = None
        self.txt = txt

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

k.y = j
k.o = h
j.x = c
j.p = l
d.r = g
d.t = a
d.o = j
a.p = d
a.r = k
g.z = a
g.o = d
g.w = l
g.s = l
g.p = h
l.z = a
l.o = m
l.w = g
l.s = g
l.p = k
m.r = g
m.t = e
m.o = j
c.x = j
c.p = l
e.p = m
e.r = k
h.y = j
h.o = k
assert h.y.p.o.t.txt == "e"