class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: D = None
        self.v: I = None
        self.z: B = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: J = None
        self.s: F = None
        self.p: A = None
        self.z: C = None
        self.y: H = None
        self.q: E = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: H = None
        self.y: E = None
        self.w: E = None
        self.q: J = None
        self.u: G = None
        self.z: A = None
        self.x: J = None
        self.r: A = None
        self.t: D = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: G = None
        self.o: B = None
        self.q: A = None
        self.x: F = None
        self.v: H = None
        self.w: H = None
        self.y: D = None
        self.s: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: J = None
        self.s: F = None
        self.p: A = None
        self.z: C = None
        self.y: H = None
        self.q: E = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: H = None
        self.y: E = None
        self.w: E = None
        self.q: J = None
        self.u: G = None
        self.z: A = None
        self.x: J = None
        self.r: A = None
        self.t: D = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: G = None
        self.o: B = None
        self.q: A = None
        self.x: F = None
        self.v: H = None
        self.w: H = None
        self.y: D = None
        self.s: F = None
        self.txt = txt

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

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