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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: I = None
        self.t: E = None
        self.r: G = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: I = None
        self.t: E = None
        self.r: G = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

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

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

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