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

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

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

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

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

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

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

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

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

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

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

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

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