class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: D = None
        self.t: E = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.w: A = None
        self.y: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.w: A = None
        self.y: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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