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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: F = None
        self.y: A = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: F = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: B = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: E = None
        self.t: C = None
        self.txt = txt

n = A("n")
e = B("e")
d = C("d")
l = D("l")
k = E("k")
i = F("i")
h = D("h")
a = C("a")
m = B("m")

n.t = k
e.x = i
e.s = i
e.y = n
e.q = n
e.o = l
d.t = k
d.y = l
l.w = k
l.q = i
l.p = d
k.u = i
k.s = m
k.v = n
k.q = n
i.u = h
i.q = k
i.t = d
h.w = k
h.q = i
h.p = d
a.t = k
a.y = l
m.x = i
m.s = i
m.y = n
m.q = n
m.o = l
assert d.t.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: F = None
        self.y: A = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: F = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: B = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: E = None
        self.t: C = None
        self.txt = txt

n = A("n")
e = B("e")
d = C("d")
l = D("l")
k = E("k")
i = F("i")
h = D("h")
a = C("a")
m = B("m")

n.t = k
e.x = i
e.s = i
e.y = n
e.q = n
e.o = l
d.t = k
d.y = l
l.w = k
l.q = i
l.p = d
k.u = i
k.s = m
k.v = n
k.q = n
i.u = h
i.q = k
i.t = d
h.w = k
h.q = i
h.p = d
a.t = k
a.y = l
m.x = i
m.s = i
m.y = n
m.q = n
m.o = l
assert d.t.u.u.txt == "h"