class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.y: H = None
        self.o: C = None
        self.q: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.t: D = None
        self.r: B = None
        self.x: I = None
        self.p: D = None
        self.q: F = None
        self.w: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: A = None
        self.w: D = None
        self.z: E = None
        self.u: I = None
        self.s: A = None
        self.v: A = None
        self.t: A = None
        self.x: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: H = None
        self.u: E = None
        self.q: A = None
        self.t: C = None
        self.x: J = None
        self.s: H = None
        self.p: F = None
        self.w: D = None
        self.o: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.t: D = None
        self.r: B = None
        self.x: I = None
        self.p: D = None
        self.q: F = None
        self.w: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: A = None
        self.w: D = None
        self.z: E = None
        self.u: I = None
        self.s: A = None
        self.v: A = None
        self.t: A = None
        self.x: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: H = None
        self.u: E = None
        self.q: A = None
        self.t: C = None
        self.x: J = None
        self.s: H = None
        self.p: F = None
        self.w: D = None
        self.o: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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