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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: A = None
        self.w: A = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: F = None
        self.x: J = None
        self.y: B = None
        self.v: D = None
        self.w: H = None
        self.t: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.q: C = None
        self.y: J = None
        self.p: F = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: B = None
        self.r: B = None
        self.o: A = None
        self.p: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: A = None
        self.w: A = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: F = None
        self.x: J = None
        self.y: B = None
        self.v: D = None
        self.w: H = None
        self.t: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.q: C = None
        self.y: J = None
        self.p: F = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: B = None
        self.r: B = None
        self.o: A = None
        self.p: G = None
        self.txt = txt

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

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

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