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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: E = None
        self.p: D = None
        self.txt = txt

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

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

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

n = A("n")
d = B("d")
g = C("g")
k = D("k")
j = E("j")
f = C("f")
e = C("e")
a = B("a")
i = B("i")

n.x = i
n.u = e
n.o = k
d.u = k
d.p = k
d.q = j
g.v = j
g.r = k
g.w = n
k.z = g
j.s = k
j.o = n
f.v = j
f.r = k
f.w = n
e.v = j
e.r = k
e.w = n
a.u = k
a.p = k
a.q = j
i.u = k
i.p = k
i.q = j
assert i.u.z.v.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: C = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: E = None
        self.p: D = None
        self.txt = txt

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

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

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

n = A("n")
d = B("d")
g = C("g")
k = D("k")
j = E("j")
f = C("f")
e = C("e")
a = B("a")
i = B("i")

n.x = i
n.u = e
n.o = k
d.u = k
d.p = k
d.q = j
g.v = j
g.r = k
g.w = n
k.z = g
j.s = k
j.o = n
f.v = j
f.r = k
f.w = n
e.v = j
e.r = k
e.w = n
a.u = k
a.p = k
a.q = j
i.u = k
i.p = k
i.q = j
assert i.u.z.v.o.o.txt == "k"