class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: F = None
        self.z: F = None
        self.y: B = None
        self.r: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: B = None
        self.p: G = None
        self.t: B = None
        self.y: G = None
        self.x: B = None
        self.txt = txt

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

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

g = A("g")
n = B("n")
a = C("a")
l = D("l")
h = E("h")
m = F("m")
k = G("k")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: B = None
        self.p: G = None
        self.t: B = None
        self.y: G = None
        self.x: B = None
        self.txt = txt

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

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

g = A("g")
n = B("n")
a = C("a")
l = D("l")
h = E("h")
m = F("m")
k = G("k")

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