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

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

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

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

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

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

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

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

f.w = e
i.r = l
i.u = n
i.s = a
i.y = e
g.q = a
g.y = a
g.x = a
g.z = l
g.u = f
g.r = f
g.t = f
l.r = f
l.x = f
l.z = n
l.w = g
n.w = g
n.s = i
n.r = l
a.y = g
m.t = i
m.y = g
m.r = a
m.z = l
e.t = i
e.y = g
e.r = a
e.z = l
assert a.y.z.x.w.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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

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

f.w = e
i.r = l
i.u = n
i.s = a
i.y = e
g.q = a
g.y = a
g.x = a
g.z = l
g.u = f
g.r = f
g.t = f
l.r = f
l.x = f
l.z = n
l.w = g
n.w = g
n.s = i
n.r = l
a.y = g
m.t = i
m.y = g
m.r = a
m.z = l
e.t = i
e.y = g
e.r = a
e.z = l
assert a.y.z.x.w.t.s.txt == "a"