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

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

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

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

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

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

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

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

n.w = b
g.s = m
g.q = m
g.u = f
g.y = f
b.r = m
e.y = d
m.w = n
m.r = g
m.z = b
m.o = f
m.y = f
m.s = d
d.z = f
d.s = n
d.w = l
d.p = b
f.s = m
a.s = m
a.q = m
a.u = f
a.y = f
l.s = m
l.q = m
l.u = f
l.y = f
assert l.q.w.w.r.r.u.s.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

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

n.w = b
g.s = m
g.q = m
g.u = f
g.y = f
b.r = m
e.y = d
m.w = n
m.r = g
m.z = b
m.o = f
m.y = f
m.s = d
d.z = f
d.s = n
d.w = l
d.p = b
f.s = m
a.s = m
a.q = m
a.u = f
a.y = f
l.s = m
l.q = m
l.u = f
l.y = f
assert l.q.w.w.r.r.u.s.w.w.txt == "b"