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

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

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

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

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

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

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

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

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

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

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

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

j.x = f
j.z = b
j.u = b
n.w = j
n.s = f
n.z = f
n.q = f
n.r = a
f.w = n
f.y = n
f.u = j
a.z = e
a.y = f
a.q = b
a.v = k
b.s = e
b.u = a
k.z = f
k.y = e
k.q = b
k.v = a
e.w = n
e.y = n
e.u = h
h.x = f
h.z = b
h.u = b
assert k.y.w.r.txt == "a"