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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: A = None
        self.txt = txt

c = A("c")
m = B("m")
h = C("h")
g = D("g")
n = E("n")
b = A("b")
j = A("j")
f = B("f")

c.w = g
c.z = b
c.o = j
m.o = g
h.v = c
h.u = g
g.p = n
g.r = h
g.z = c
n.v = g
n.p = j
b.w = g
b.z = c
b.o = j
j.w = g
j.z = c
j.o = b
f.o = g
assert m.o.r.u.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: A = None
        self.o: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: A = None
        self.txt = txt

c = A("c")
m = B("m")
h = C("h")
g = D("g")
n = E("n")
b = A("b")
j = A("j")
f = B("f")

c.w = g
c.z = b
c.o = j
m.o = g
h.v = c
h.u = g
g.p = n
g.r = h
g.z = c
n.v = g
n.p = j
b.w = g
b.z = c
b.o = j
j.w = g
j.z = c
j.o = b
f.o = g
assert m.o.r.u.r.u.txt == "g"