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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: A = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: F = None
        self.p: B = None
        self.y: F = None
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: E = None
        self.y: H = None
        self.txt = txt

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

m = A("m")
l = B("l")
e = C("e")
f = D("f")
n = E("n")
c = F("c")
h = G("h")
k = H("k")
g = B("g")
j = A("j")

m.o = c
l.z = j
l.u = j
l.w = h
e.r = f
e.t = c
e.y = c
e.p = l
e.v = k
f.y = n
f.o = j
n.s = f
n.y = l
n.r = c
n.z = e
c.r = k
c.u = n
h.t = c
h.p = n
h.y = k
k.s = e
g.z = m
g.u = m
g.w = h
j.o = c
assert n.y.u.o.u.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: A = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: F = None
        self.p: B = None
        self.y: F = None
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: E = None
        self.y: H = None
        self.txt = txt

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

m = A("m")
l = B("l")
e = C("e")
f = D("f")
n = E("n")
c = F("c")
h = G("h")
k = H("k")
g = B("g")
j = A("j")

m.o = c
l.z = j
l.u = j
l.w = h
e.r = f
e.t = c
e.y = c
e.p = l
e.v = k
f.y = n
f.o = j
n.s = f
n.y = l
n.r = c
n.z = e
c.r = k
c.u = n
h.t = c
h.p = n
h.y = k
k.s = e
g.z = m
g.u = m
g.w = h
j.o = c
assert n.y.u.o.u.r.u.txt == "n"