class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: G = None
        self.p: D = None
        self.w: D = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: J = None
        self.v: B = None
        self.t: F = None
        self.x: E = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: J = None
        self.v: B = None
        self.t: F = None
        self.x: E = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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