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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: E = None
        self.u: A = None
        self.x: H = None
        self.y: F = None
        self.p: A = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: I = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.s: A = None
        self.y: B = None
        self.o: B = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: E = None
        self.u: I = None
        self.z: D = None
        self.y: A = None
        self.x: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: E = None
        self.u: A = None
        self.x: H = None
        self.y: F = None
        self.p: A = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: I = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.s: A = None
        self.y: B = None
        self.o: B = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: E = None
        self.u: I = None
        self.z: D = None
        self.y: A = None
        self.x: D = None
        self.txt = txt

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

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

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