class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: F = None
        self.t: C = None
        self.o: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.q: F = None
        self.t: C = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: C = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.v: J = None
        self.u: J = None
        self.t: G = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: A = None
        self.q: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.q: F = None
        self.t: C = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: C = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.v: J = None
        self.u: J = None
        self.t: G = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: A = None
        self.q: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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