class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: B = None
        self.s: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: I = None
        self.x: G = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: A = None
        self.r: H = None
        self.o: B = None
        self.q: D = None
        self.w: B = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: I = None
        self.x: G = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: A = None
        self.r: H = None
        self.o: B = None
        self.q: D = None
        self.w: B = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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