class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: C = None
        self.p: A = None
        self.z: J = None
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: I = None
        self.r: G = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: B = None
        self.r: C = None
        self.x: F = None
        self.q: H = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: C = None
        self.v: I = None
        self.q: C = None
        self.r: A = None
        self.o: B = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.y: H = None
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.v: J = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: D = None
        self.p: D = None
        self.v: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.o: A = None
        self.t: I = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: C = None
        self.p: A = None
        self.z: J = None
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: I = None
        self.r: G = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: B = None
        self.r: C = None
        self.x: F = None
        self.q: H = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: C = None
        self.v: I = None
        self.q: C = None
        self.r: A = None
        self.o: B = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.y: H = None
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.v: J = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: D = None
        self.p: D = None
        self.v: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.o: A = None
        self.t: I = None
        self.q: D = None
        self.txt = txt

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

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