class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: D = None
        self.x: C = None
        self.w: B = None
        self.t: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: A = None
        self.v: B = None
        self.x: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: D = None
        self.o: B = None
        self.x: I = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: A = None
        self.v: B = None
        self.x: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: D = None
        self.o: B = None
        self.x: I = None
        self.v: A = None
        self.txt = txt

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

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