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

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

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

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

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

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

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

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

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

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

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

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

h.r = i
a.y = j
a.v = j
a.o = b
a.w = f
i.q = l
i.p = f
i.u = h
i.s = h
i.x = b
m.x = j
m.z = j
n.s = b
n.x = j
b.y = j
b.v = j
b.o = k
b.w = n
j.x = m
j.z = m
l.q = i
l.p = n
l.u = h
l.s = h
l.x = b
f.s = b
f.x = j
k.y = j
k.v = j
k.o = a
k.w = n
assert b.w.s.w.s.txt == "b"