class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: D = None
        self.t: C = None
        self.p: C = None
        self.u: D = None
        self.x: C = None
        self.z: I = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: G = None
        self.u: D = None
        self.r: E = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: F = None
        self.w: H = None
        self.y: E = None
        self.z: C = None
        self.t: B = None
        self.x: A = None
        self.q: F = None
        self.p: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: G = None
        self.w: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: D = None
        self.o: F = None
        self.r: A = None
        self.w: C = None
        self.y: A = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: G = None
        self.u: D = None
        self.r: E = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: F = None
        self.w: H = None
        self.y: E = None
        self.z: C = None
        self.t: B = None
        self.x: A = None
        self.q: F = None
        self.p: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: G = None
        self.w: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: D = None
        self.o: F = None
        self.r: A = None
        self.w: C = None
        self.y: A = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: C = None
        self.txt = txt

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

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