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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: B = None
        self.z: B = None
        self.w: E = None
        self.y: D = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: A = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: C = None
        self.s: F = None
        self.q: A = None
        self.y: D = None
        self.v: C = None
        self.p: A = None
        self.txt = txt

j = A("j")
e = B("e")
h = C("h")
n = D("n")
f = E("f")
l = F("l")
d = G("d")
k = C("k")

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: B = None
        self.z: B = None
        self.w: E = None
        self.y: D = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: A = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: C = None
        self.s: F = None
        self.q: A = None
        self.y: D = None
        self.v: C = None
        self.p: A = None
        self.txt = txt

j = A("j")
e = B("e")
h = C("h")
n = D("n")
f = E("f")
l = F("l")
d = G("d")
k = C("k")

j.s = n
e.u = l
e.w = d
e.q = j
h.p = f
h.w = f
h.r = e
h.z = e
h.y = n
h.u = d
n.s = k
n.w = k
n.t = d
n.p = h
n.r = j
n.y = l
f.y = e
f.v = j
f.x = j
l.y = d
d.r = e
d.w = k
d.s = l
d.q = j
d.p = j
d.y = n
d.v = h
k.p = f
k.w = f
k.r = e
k.z = e
k.y = n
k.u = d
assert k.r.w.r.q.s.txt == "n"