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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.r: C = None
        self.v: C = None
        self.p: B = None
        self.txt = txt

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

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

a = A("a")
n = B("n")
e = C("e")
d = D("d")
b = E("b")
m = A("m")
j = B("j")
k = C("k")
c = E("c")
f = B("f")

a.y = e
a.w = m
a.t = m
a.o = k
n.q = d
n.x = e
n.o = b
e.t = k
e.r = k
e.v = k
e.x = m
e.p = f
d.z = b
b.z = d
m.y = e
m.w = a
m.t = a
m.o = k
j.q = d
j.x = e
j.o = b
k.t = e
k.r = e
k.v = e
k.x = a
k.p = f
c.z = d
f.q = d
f.x = e
f.o = b
assert f.x.x.y.r.x.t.t.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: A = None
        self.o: C = None
        self.t: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.r: C = None
        self.v: C = None
        self.p: B = None
        self.txt = txt

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

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

a = A("a")
n = B("n")
e = C("e")
d = D("d")
b = E("b")
m = A("m")
j = B("j")
k = C("k")
c = E("c")
f = B("f")

a.y = e
a.w = m
a.t = m
a.o = k
n.q = d
n.x = e
n.o = b
e.t = k
e.r = k
e.v = k
e.x = m
e.p = f
d.z = b
b.z = d
m.y = e
m.w = a
m.t = a
m.o = k
j.q = d
j.x = e
j.o = b
k.t = e
k.r = e
k.v = e
k.x = a
k.p = f
c.z = d
f.q = d
f.x = e
f.o = b
assert f.x.x.y.r.x.t.t.w.o.txt == "k"