class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: F = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: E = None
        self.r: E = None
        self.t: E = None
        self.v: A = None
        self.q: B = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: A = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: H = None
        self.r: H = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: I = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: E = None
        self.r: E = None
        self.t: E = None
        self.v: A = None
        self.q: B = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: A = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: H = None
        self.r: H = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: I = None
        self.r: G = None
        self.txt = txt

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

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

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

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