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

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

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

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

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

f = A("f")
b = B("b")
h = C("h")
a = D("a")
l = E("l")
j = C("j")
e = A("e")
c = D("c")
m = B("m")
i = D("i")

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

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

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

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

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

f = A("f")
b = B("b")
h = C("h")
a = D("a")
l = E("l")
j = C("j")
e = A("e")
c = D("c")
m = B("m")
i = D("i")

f.r = e
f.z = e
f.o = j
b.u = h
b.p = l
b.t = f
h.u = l
h.w = e
h.o = j
a.z = m
l.y = m
j.u = l
j.w = f
j.o = h
e.r = f
e.z = f
e.o = j
c.z = b
m.u = j
m.p = l
m.t = f
i.z = b
assert l.y.u.w.o.o.u.y.txt == "m"