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

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

n = A("n")
l = B("l")
e = C("e")
i = D("i")
c = E("c")
j = F("j")
d = G("d")
g = C("g")
a = E("a")
b = C("b")

n.s = l
n.w = j
l.t = j
l.s = j
l.v = e
l.w = e
l.r = i
e.w = j
e.q = n
i.p = d
i.x = j
c.y = i
c.v = d
c.t = l
j.p = e
j.q = d
j.r = l
j.w = a
d.r = e
g.w = j
g.q = n
a.y = i
a.v = d
a.t = l
b.w = j
b.q = n
assert n.s.w.w.r.r.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

n = A("n")
l = B("l")
e = C("e")
i = D("i")
c = E("c")
j = F("j")
d = G("d")
g = C("g")
a = E("a")
b = C("b")

n.s = l
n.w = j
l.t = j
l.s = j
l.v = e
l.w = e
l.r = i
e.w = j
e.q = n
i.p = d
i.x = j
c.y = i
c.v = d
c.t = l
j.p = e
j.q = d
j.r = l
j.w = a
d.r = e
g.w = j
g.q = n
a.y = i
a.v = d
a.t = l
b.w = j
b.q = n
assert n.s.w.w.r.r.p.r.txt == "e"