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

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

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

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

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

g = A("g")
l = B("l")
i = C("i")
b = D("b")
e = E("e")
a = C("a")
n = A("n")
f = D("f")
m = B("m")

g.z = a
l.r = e
l.w = e
i.p = a
i.v = e
i.u = m
b.r = n
b.y = a
b.t = f
b.v = f
b.u = e
e.u = f
e.r = b
a.p = i
a.v = e
a.u = m
n.z = i
f.r = n
f.y = a
f.t = b
f.v = b
f.u = e
m.r = e
m.w = e
assert b.r.z.p.u.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

g = A("g")
l = B("l")
i = C("i")
b = D("b")
e = E("e")
a = C("a")
n = A("n")
f = D("f")
m = B("m")

g.z = a
l.r = e
l.w = e
i.p = a
i.v = e
i.u = m
b.r = n
b.y = a
b.t = f
b.v = f
b.u = e
e.u = f
e.r = b
a.p = i
a.v = e
a.u = m
n.z = i
f.r = n
f.y = a
f.t = b
f.v = b
f.u = e
m.r = e
m.w = e
assert b.r.z.p.u.r.r.r.txt == "n"