class A:
    def __init__(self, txt: str):
        self.p: J = None
        self.t: F = None
        self.z: F = None
        self.v: G = None
        self.q: C = None
        self.r: F = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: F = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: G = None
        self.o: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: B = None
        self.u: G = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: H = None
        self.r: B = None
        self.w: A = None
        self.x: J = None
        self.t: E = None
        self.q: H = None
        self.o: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: G = None
        self.v: A = None
        self.r: C = None
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: A = None
        self.y: D = None
        self.z: G = None
        self.q: E = None
        self.o: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: F = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: G = None
        self.o: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: B = None
        self.u: G = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: H = None
        self.r: B = None
        self.w: A = None
        self.x: J = None
        self.t: E = None
        self.q: H = None
        self.o: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: G = None
        self.v: A = None
        self.r: C = None
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: A = None
        self.y: D = None
        self.z: G = None
        self.q: E = None
        self.o: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: C = None
        self.txt = txt

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

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