class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.x: E = None
        self.r: C = None
        self.t: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: H = None
        self.z: G = None
        self.t: D = None
        self.s: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.x: E = None
        self.r: C = None
        self.t: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: H = None
        self.z: G = None
        self.t: D = None
        self.s: I = None
        self.txt = txt

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

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