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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: C = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: F = None
        self.x: C = None
        self.r: A = None
        self.o: F = None
        self.s: D = None
        self.txt = txt

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

l.s = f
j.u = d
j.t = f
j.v = l
d.w = a
d.y = f
d.s = l
f.t = d
f.w = n
f.r = m
e.s = a
e.t = m
m.o = j
m.s = f
a.u = j
a.z = m
a.o = m
a.x = d
a.r = l
a.s = f
g.u = d
g.t = f
g.v = l
n.w = a
n.y = f
n.s = l
assert n.y.w.s.s.t.y.t.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: C = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: F = None
        self.x: C = None
        self.r: A = None
        self.o: F = None
        self.s: D = None
        self.txt = txt

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

l.s = f
j.u = d
j.t = f
j.v = l
d.w = a
d.y = f
d.s = l
f.t = d
f.w = n
f.r = m
e.s = a
e.t = m
m.o = j
m.s = f
a.u = j
a.z = m
a.o = m
a.x = d
a.r = l
a.s = f
g.u = d
g.t = f
g.v = l
n.w = a
n.y = f
n.s = l
assert n.y.w.s.s.t.y.t.w.z.txt == "m"