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

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

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

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

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

f = A("f")
c = B("c")
j = C("j")
i = D("i")
e = E("e")
a = B("a")
m = B("m")
g = D("g")
d = D("d")

f.u = m
f.s = j
f.x = a
f.v = e
f.w = e
c.u = i
c.t = i
c.x = j
j.r = f
j.x = d
j.o = c
j.z = a
i.o = f
e.o = m
e.r = j
e.u = j
a.u = g
a.t = d
a.x = j
m.u = d
m.t = d
m.x = j
g.o = f
d.o = f
assert g.o.s.x.o.s.x.o.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: C = None
        self.x: B = None
        self.v: E = None
        self.w: E = None
        self.txt = txt

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

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

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

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

f = A("f")
c = B("c")
j = C("j")
i = D("i")
e = E("e")
a = B("a")
m = B("m")
g = D("g")
d = D("d")

f.u = m
f.s = j
f.x = a
f.v = e
f.w = e
c.u = i
c.t = i
c.x = j
j.r = f
j.x = d
j.o = c
j.z = a
i.o = f
e.o = m
e.r = j
e.u = j
a.u = g
a.t = d
a.x = j
m.u = d
m.t = d
m.x = j
g.o = f
d.o = f
assert g.o.s.x.o.s.x.o.s.o.txt == "c"