class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: D = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: H = None
        self.t: G = None
        self.w: J = None
        self.x: G = None
        self.y: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: F = None
        self.w: J = None
        self.p: G = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: I = None
        self.s: E = None
        self.v: J = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: A = None
        self.w: J = None
        self.o: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: I = None
        self.u: G = None
        self.o: H = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: H = None
        self.t: G = None
        self.w: J = None
        self.x: G = None
        self.y: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: F = None
        self.w: J = None
        self.p: G = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: I = None
        self.s: E = None
        self.v: J = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: A = None
        self.w: J = None
        self.o: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: I = None
        self.u: G = None
        self.o: H = None
        self.t: F = None
        self.txt = txt

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

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