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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.o: E = None
        self.p: D = None
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.o: B = None
        self.txt = txt

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

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

n.o = m
n.w = m
n.t = l
k.v = j
k.r = h
k.o = m
k.p = l
k.q = a
h.x = g
h.w = f
l.s = k
l.o = k
l.t = f
m.x = g
f.x = m
f.w = h
i.o = g
i.w = g
i.t = l
a.s = k
a.o = k
a.t = h
g.x = m
j.o = m
j.t = l
j.w = g
assert m.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: D = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.o: E = None
        self.p: D = None
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.o: B = None
        self.txt = txt

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

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

n.o = m
n.w = m
n.t = l
k.v = j
k.r = h
k.o = m
k.p = l
k.q = a
h.x = g
h.w = f
l.s = k
l.o = k
l.t = f
m.x = g
f.x = m
f.w = h
i.o = g
i.w = g
i.t = l
a.s = k
a.o = k
a.t = h
g.x = m
j.o = m
j.t = l
j.w = g
assert m.x.x.x.x.txt == "m"