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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: E = None
        self.r: C = None
        self.z: D = None
        self.t: E = None
        self.txt = txt

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

d = A("d")
h = B("h")
c = C("c")
i = D("i")
f = E("f")
a = B("a")
k = D("k")
m = D("m")

d.u = f
d.z = f
h.o = f
h.x = f
h.u = d
h.w = c
h.t = c
c.q = d
c.o = a
c.w = f
i.o = h
i.s = f
i.t = f
i.r = c
i.z = m
f.r = d
a.o = f
a.x = f
a.u = d
a.w = c
a.t = c
k.o = a
k.s = f
k.t = f
k.r = c
k.z = i
m.o = h
m.s = f
m.t = f
m.r = c
m.z = k
assert a.o.r.u.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: E = None
        self.r: C = None
        self.z: D = None
        self.t: E = None
        self.txt = txt

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

d = A("d")
h = B("h")
c = C("c")
i = D("i")
f = E("f")
a = B("a")
k = D("k")
m = D("m")

d.u = f
d.z = f
h.o = f
h.x = f
h.u = d
h.w = c
h.t = c
c.q = d
c.o = a
c.w = f
i.o = h
i.s = f
i.t = f
i.r = c
i.z = m
f.r = d
a.o = f
a.x = f
a.u = d
a.w = c
a.t = c
k.o = a
k.s = f
k.t = f
k.r = c
k.z = i
m.o = h
m.s = f
m.t = f
m.r = c
m.z = k
assert a.o.r.u.r.u.txt == "f"