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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.txt = txt

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

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

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

a.u = f
a.o = b
a.z = j
a.r = l
b.s = j
b.w = d
f.y = g
f.o = b
f.x = b
m.s = a
m.u = d
l.s = a
l.u = g
c.s = d
c.u = e
d.u = f
d.o = b
d.z = l
d.r = c
j.s = e
j.u = d
g.u = f
g.o = b
g.z = m
g.r = m
e.u = f
e.o = b
e.z = j
e.r = l
assert a.o.w.z.u.r.txt == "m"