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

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

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

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

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

k = A("k")
i = B("i")
g = C("g")
h = D("h")
a = E("a")
n = B("n")

k.z = h
k.u = h
k.s = a
k.v = g
i.w = k
i.o = n
i.p = a
g.x = a
g.v = a
h.r = g
h.u = g
h.w = k
h.t = k
a.y = i
a.u = i
n.w = k
n.o = i
n.p = a
assert n.o.o.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.u: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

k = A("k")
i = B("i")
g = C("g")
h = D("h")
a = E("a")
n = B("n")

k.z = h
k.u = h
k.s = a
k.v = g
i.w = k
i.o = n
i.p = a
g.x = a
g.v = a
h.r = g
h.u = g
h.w = k
h.t = k
a.y = i
a.u = i
n.w = k
n.o = i
n.p = a
assert n.o.o.p.u.txt == "i"