class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.r: E = None
        self.p: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: A = None
        self.v: C = None
        self.o: B = None
        self.txt = txt

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

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

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

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

j.w = i
j.u = n
j.r = g
j.p = m
m.v = e
m.z = g
l.w = g
l.s = g
l.u = n
l.r = m
l.p = m
i.z = e
i.y = j
i.v = l
i.o = m
g.s = l
g.p = i
g.z = n
n.u = j
n.z = j
n.x = m
n.o = m
n.r = g
n.w = g
n.s = l
e.q = m
e.v = i
e.s = j
assert n.x.z.s.r.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.r: E = None
        self.p: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: A = None
        self.v: C = None
        self.o: B = None
        self.txt = txt

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

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

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

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

j.w = i
j.u = n
j.r = g
j.p = m
m.v = e
m.z = g
l.w = g
l.s = g
l.u = n
l.r = m
l.p = m
i.z = e
i.y = j
i.v = l
i.o = m
g.s = l
g.p = i
g.z = n
n.u = j
n.z = j
n.x = m
n.o = m
n.r = g
n.w = g
n.s = l
e.q = m
e.v = i
e.s = j
assert n.x.z.s.r.v.s.txt == "j"