class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: I = None
        self.r: D = None
        self.z: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: G = None
        self.q: B = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: F = None
        self.z: H = None
        self.v: E = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: C = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: E = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

l = A("l")
b = B("b")
k = C("k")
h = D("h")
m = E("m")
i = F("i")
c = G("c")
d = H("d")
f = I("f")

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: G = None
        self.q: B = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: F = None
        self.z: H = None
        self.v: E = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: C = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: E = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

l = A("l")
b = B("b")
k = C("k")
h = D("h")
m = E("m")
i = F("i")
c = G("c")
d = H("d")
f = I("f")

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