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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.z: E = None
        self.u: A = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.z: E = None
        self.u: A = None
        self.s: C = None
        self.txt = txt

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

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

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

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

k.o = c
k.u = c
b.y = g
b.s = g
b.x = j
b.u = j
b.z = c
g.y = b
g.v = c
g.w = m
g.x = d
g.r = k
m.p = g
m.z = d
m.x = d
c.t = k
c.x = b
c.v = g
c.z = d
j.o = c
j.u = c
n.y = g
n.s = g
n.x = k
n.u = k
n.z = c
d.p = g
d.z = m
d.x = m
assert j.o.z.p.y.x.o.x.txt == "b"