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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.o: D = None
        self.p: A = None
        self.txt = txt

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

b = A("b")
f = B("f")
e = C("e")
l = D("l")
n = E("n")
c = E("c")
h = D("h")
k = A("k")
d = B("d")

b.w = l
b.o = l
b.r = e
b.v = n
f.x = e
f.p = e
f.v = n
f.w = l
f.q = h
e.x = l
e.z = b
l.s = b
l.t = f
l.o = h
l.p = k
n.r = f
c.r = f
h.s = k
h.p = k
h.t = f
h.o = l
k.w = l
k.o = l
k.r = e
k.v = n
d.x = e
d.p = e
d.v = n
d.w = l
d.q = h
assert n.r.q.t.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: C = None
        self.o: D = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.o: D = None
        self.p: A = None
        self.txt = txt

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

b = A("b")
f = B("f")
e = C("e")
l = D("l")
n = E("n")
c = E("c")
h = D("h")
k = A("k")
d = B("d")

b.w = l
b.o = l
b.r = e
b.v = n
f.x = e
f.p = e
f.v = n
f.w = l
f.q = h
e.x = l
e.z = b
l.s = b
l.t = f
l.o = h
l.p = k
n.r = f
c.r = f
h.s = k
h.p = k
h.t = f
h.o = l
k.w = l
k.o = l
k.r = e
k.v = n
d.x = e
d.p = e
d.v = n
d.w = l
d.q = h
assert n.r.q.t.w.o.txt == "h"