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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: E = None
        self.y: B = None
        self.x: D = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: A = None
        self.p: E = None
        self.t: E = None
        self.y: A = None
        self.txt = txt

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

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

d.q = c
d.u = c
j.o = g
g.q = m
g.x = m
g.u = m
g.p = b
g.y = k
m.o = g
m.u = d
m.y = d
m.p = h
m.t = h
b.x = k
b.z = k
b.q = h
h.x = k
h.z = j
h.q = b
c.q = m
c.x = m
c.u = m
c.p = h
c.y = k
k.o = g
assert j.o.p.q.z.o.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: E = None
        self.y: B = None
        self.x: D = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: A = None
        self.p: E = None
        self.t: E = None
        self.y: A = None
        self.txt = txt

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

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

d.q = c
d.u = c
j.o = g
g.q = m
g.x = m
g.u = m
g.p = b
g.y = k
m.o = g
m.u = d
m.y = d
m.p = h
m.t = h
b.x = k
b.z = k
b.q = h
h.x = k
h.z = j
h.q = b
c.q = m
c.x = m
c.u = m
c.p = h
c.y = k
k.o = g
assert j.o.p.q.z.o.p.q.txt == "h"