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

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: E = None
        self.y: D = None
        self.w: C = None
        self.txt = txt

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

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

j = A("j")
g = B("g")
i = C("i")
k = D("k")
m = E("m")
l = E("l")
n = B("n")
c = C("c")

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

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: E = None
        self.y: D = None
        self.w: C = None
        self.txt = txt

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

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

j = A("j")
g = B("g")
i = C("i")
k = D("k")
m = E("m")
l = E("l")
n = B("n")
c = C("c")

j.o = k
g.r = c
g.s = k
g.o = k
g.w = m
g.z = n
i.x = c
i.w = c
i.u = m
i.y = k
k.t = l
k.y = n
m.s = i
m.u = i
l.s = c
l.u = c
n.r = c
n.s = k
n.o = k
n.w = m
n.z = g
c.x = i
c.w = i
c.u = m
c.y = k
assert g.z.w.s.x.y.t.s.y.txt == "k"