class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: G = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: A = None
        self.w: F = None
        self.z: J = None
        self.p: F = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: E = None
        self.s: E = None
        self.y: H = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: A = None
        self.w: F = None
        self.z: J = None
        self.p: F = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: E = None
        self.s: E = None
        self.y: H = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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