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

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: G = None
        self.r: D = None
        self.u: D = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: G = None
        self.r: D = None
        self.u: D = None
        self.v: G = None
        self.txt = txt

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

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

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

g.v = f
g.z = k
g.s = b
f.y = a
a.z = k
a.y = b
a.w = b
a.t = m
a.r = e
n.v = b
e.z = b
e.x = b
e.v = b
e.r = n
e.u = n
k.s = f
b.s = g
m.z = k
m.y = b
m.w = b
m.t = a
m.r = e
assert g.v.y.z.s.txt == "f"