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

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

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

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

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

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

b.r = a
b.w = a
b.t = e
b.z = k
n.u = a
n.p = a
n.q = g
n.x = f
g.p = a
g.r = a
g.o = j
g.z = f
f.s = c
f.z = e
f.o = e
f.t = k
e.o = a
a.p = g
a.r = g
a.o = e
a.z = f
c.u = g
c.q = g
c.x = f
c.p = a
k.u = g
k.p = g
k.q = a
k.x = f
j.o = a
assert j.o.p.z.o.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: C = None
        self.t: E = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

b.r = a
b.w = a
b.t = e
b.z = k
n.u = a
n.p = a
n.q = g
n.x = f
g.p = a
g.r = a
g.o = j
g.z = f
f.s = c
f.z = e
f.o = e
f.t = k
e.o = a
a.p = g
a.r = g
a.o = e
a.z = f
c.u = g
c.q = g
c.x = f
c.p = a
k.u = g
k.p = g
k.q = a
k.x = f
j.o = a
assert j.o.p.z.o.o.r.txt == "g"