class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.w: D = None
        self.r: C = None
        self.t: E = None
        self.v: B = None
        self.x: D = None
        self.y: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: A = None
        self.x: G = None
        self.o: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: A = None
        self.w: A = None
        self.s: C = None
        self.r: A = None
        self.o: B = None
        self.p: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.z: F = None
        self.t: C = None
        self.o: D = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: G = None
        self.txt = txt

m = A("m")
l = B("l")
j = C("j")
a = D("a")
d = E("d")
e = F("e")
i = G("i")
g = H("g")
n = F("n")

m.u = n
m.s = d
m.t = d
m.w = a
m.x = a
m.r = j
m.v = l
m.y = i
l.t = a
l.s = n
j.s = l
j.q = l
j.r = m
j.y = e
j.t = n
j.x = n
j.o = g
a.t = i
a.x = i
a.z = m
a.o = j
d.o = a
e.q = n
e.p = n
e.u = m
e.w = m
e.r = m
e.s = j
e.o = l
i.r = a
i.x = a
i.o = a
i.z = n
i.t = j
i.v = g
g.y = l
g.s = i
n.q = e
n.p = e
n.u = m
n.w = m
n.r = m
n.s = j
n.o = l
assert i.o.o.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.w: D = None
        self.r: C = None
        self.t: E = None
        self.v: B = None
        self.x: D = None
        self.y: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: A = None
        self.x: G = None
        self.o: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: A = None
        self.w: A = None
        self.s: C = None
        self.r: A = None
        self.o: B = None
        self.p: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.z: F = None
        self.t: C = None
        self.o: D = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: G = None
        self.txt = txt

m = A("m")
l = B("l")
j = C("j")
a = D("a")
d = E("d")
e = F("e")
i = G("i")
g = H("g")
n = F("n")

m.u = n
m.s = d
m.t = d
m.w = a
m.x = a
m.r = j
m.v = l
m.y = i
l.t = a
l.s = n
j.s = l
j.q = l
j.r = m
j.y = e
j.t = n
j.x = n
j.o = g
a.t = i
a.x = i
a.z = m
a.o = j
d.o = a
e.q = n
e.p = n
e.u = m
e.w = m
e.r = m
e.s = j
e.o = l
i.r = a
i.x = a
i.o = a
i.z = n
i.t = j
i.v = g
g.y = l
g.s = i
n.q = e
n.p = e
n.u = m
n.w = m
n.r = m
n.s = j
n.o = l
assert i.o.o.t.o.txt == "l"