class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: J = None
        self.r: I = None
        self.p: H = None
        self.w: J = None
        self.v: C = None
        self.q: H = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: E = None
        self.x: B = None
        self.t: H = None
        self.u: J = None
        self.z: G = None
        self.p: B = None
        self.s: E = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: A = None
        self.s: I = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: E = None
        self.y: J = None
        self.u: D = None
        self.o: D = None
        self.q: G = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: I = None
        self.r: I = None
        self.o: E = None
        self.t: I = None
        self.z: E = None
        self.y: F = None
        self.p: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: A = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: H = None
        self.y: E = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

i = A("i")
m = B("m")
g = C("g")
j = D("j")
k = E("k")
n = F("n")
c = G("c")
d = H("d")
l = I("l")
b = J("b")

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: E = None
        self.x: B = None
        self.t: H = None
        self.u: J = None
        self.z: G = None
        self.p: B = None
        self.s: E = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: A = None
        self.s: I = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: E = None
        self.y: J = None
        self.u: D = None
        self.o: D = None
        self.q: G = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: I = None
        self.r: I = None
        self.o: E = None
        self.t: I = None
        self.z: E = None
        self.y: F = None
        self.p: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: A = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: H = None
        self.y: E = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

i = A("i")
m = B("m")
g = C("g")
j = D("j")
k = E("k")
n = F("n")
c = G("c")
d = H("d")
l = I("l")
b = J("b")

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