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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: C = None
        self.p: G = None
        self.s: A = None
        self.w: G = None
        self.x: D = None
        self.y: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: A = None
        self.v: A = None
        self.t: F = None
        self.txt = txt

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

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

f = A("f")
d = B("d")
k = C("k")
n = D("n")
m = E("m")
b = F("b")
e = G("e")
h = G("h")
g = F("g")
i = G("i")

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: C = None
        self.p: G = None
        self.s: A = None
        self.w: G = None
        self.x: D = None
        self.y: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: A = None
        self.v: A = None
        self.t: F = None
        self.txt = txt

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

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

f = A("f")
d = B("d")
k = C("k")
n = D("n")
m = E("m")
b = F("b")
e = G("e")
h = G("h")
g = F("g")
i = G("i")

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