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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: J = None
        self.r: G = None
        self.u: I = None
        self.t: G = None
        self.z: F = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: I = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: B = None
        self.x: I = None
        self.s: F = None
        self.u: A = None
        self.o: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: A = None
        self.s: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: J = None
        self.r: G = None
        self.u: I = None
        self.t: G = None
        self.z: F = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: I = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: B = None
        self.x: I = None
        self.s: F = None
        self.u: A = None
        self.o: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: A = None
        self.s: J = None
        self.txt = txt

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

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

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