class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: A = None
        self.o: F = None
        self.v: E = None
        self.t: H = None
        self.y: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: G = None
        self.o: G = None
        self.v: I = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: C = None
        self.y: B = None
        self.r: D = None
        self.u: I = None
        self.z: A = None
        self.q: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: A = None
        self.o: F = None
        self.v: E = None
        self.t: H = None
        self.y: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: G = None
        self.o: G = None
        self.v: I = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: C = None
        self.y: B = None
        self.r: D = None
        self.u: I = None
        self.z: A = None
        self.q: C = None
        self.txt = txt

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

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

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

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