class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: H = None
        self.u: H = None
        self.t: D = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: A = None
        self.x: G = None
        self.q: I = None
        self.y: H = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.r: I = None
        self.y: G = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.r: B = None
        self.u: F = None
        self.w: E = None
        self.q: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: A = None
        self.x: G = None
        self.q: I = None
        self.y: H = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.r: I = None
        self.y: G = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.r: B = None
        self.u: F = None
        self.w: E = None
        self.q: G = None
        self.txt = txt

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

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

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