class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: G = None
        self.q: D = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: I = None
        self.s: B = None
        self.x: G = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.s: C = None
        self.w: G = None
        self.x: E = None
        self.t: E = None
        self.v: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: I = None
        self.s: B = None
        self.x: G = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.s: C = None
        self.w: G = None
        self.x: E = None
        self.t: E = None
        self.v: B = None
        self.txt = txt

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

k.r = d
k.t = i
k.q = m
k.y = m
n.r = a
n.q = l
n.x = l
n.z = i
n.p = k
n.o = h
d.o = l
d.z = b
d.s = n
d.x = i
d.v = a
m.p = d
m.x = l
m.z = l
a.y = h
a.o = h
a.z = l
a.v = m
a.r = d
a.w = k
a.s = i
h.z = a
h.v = k
h.y = k
h.x = i
h.r = i
i.p = b
l.v = d
b.w = a
b.t = a
b.o = d
b.q = m
b.y = i
b.s = h
b.z = h
b.p = l
g.p = k
g.r = a
g.x = a
g.t = a
g.s = d
g.w = i
g.v = n
assert h.y.r.z.o.x.p.txt == "b"