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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: D = None
        self.r: E = None
        self.w: C = None
        self.x: A = None
        self.txt = txt

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

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

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

j = A("j")
n = B("n")
a = C("a")
c = D("c")
f = E("f")
m = A("m")
h = B("h")
d = D("d")
l = B("l")

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: D = None
        self.r: E = None
        self.w: C = None
        self.x: A = None
        self.txt = txt

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

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

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

j = A("j")
n = B("n")
a = C("a")
c = D("c")
f = E("f")
m = A("m")
h = B("h")
d = D("d")
l = B("l")

j.t = m
j.x = m
j.p = m
j.z = a
n.q = a
n.w = a
n.s = c
n.r = f
n.x = j
a.t = f
a.v = n
c.u = a
c.v = a
c.p = d
f.x = a
f.o = a
m.t = j
m.x = j
m.p = j
m.z = a
h.q = a
h.w = a
h.s = d
h.r = f
h.x = j
d.u = a
d.v = a
d.p = c
l.q = a
l.w = a
l.s = c
l.r = f
l.x = j
assert f.o.v.w.t.o.v.txt == "n"