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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.u: B = None
        self.r: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.u: B = None
        self.r: B = None
        self.z: C = None
        self.txt = txt

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

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