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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: I = None
        self.z: E = None
        self.w: A = None
        self.p: D = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.y: E = None
        self.w: I = None
        self.x: H = None
        self.s: A = None
        self.v: C = None
        self.p: E = None
        self.o: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: C = None
        self.q: A = None
        self.v: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: I = None
        self.z: E = None
        self.w: A = None
        self.p: D = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.y: E = None
        self.w: I = None
        self.x: H = None
        self.s: A = None
        self.v: C = None
        self.p: E = None
        self.o: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: C = None
        self.q: A = None
        self.v: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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