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

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: D = None
        self.z: C = None
        self.r: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: D = None
        self.z: C = None
        self.r: B = None
        self.o: D = None
        self.txt = txt

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

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

a.x = n
a.w = b
c.s = d
c.x = n
n.y = a
n.u = d
n.s = m
b.y = h
b.w = k
b.o = k
b.z = n
b.r = d
m.w = d
m.o = a
m.p = a
m.r = b
m.t = n
k.y = b
k.o = b
k.w = h
k.z = n
k.r = d
h.y = b
h.w = k
h.o = k
h.z = n
h.r = d
j.w = d
j.o = a
j.p = a
j.r = h
j.t = n
d.s = c
d.x = n
assert k.w.y.y.txt == "h"