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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: F = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.y: G = None
        self.u: A = None
        self.q: E = None
        self.r: G = None
        self.o: B = None
        self.txt = txt

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

n = A("n")
l = B("l")
i = C("i")
m = D("m")
c = E("c")
a = F("a")
d = G("d")

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: F = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.y: G = None
        self.u: A = None
        self.q: E = None
        self.r: G = None
        self.o: B = None
        self.txt = txt

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

n = A("n")
l = B("l")
i = C("i")
m = D("m")
c = E("c")
a = F("a")
d = G("d")

n.r = m
l.w = d
i.o = l
i.x = a
i.p = n
m.z = i
m.o = c
c.q = n
c.u = m
a.w = m
a.x = n
a.u = n
a.y = d
a.r = d
a.q = c
a.o = l
d.t = l
d.u = n
d.z = i
d.x = i
d.w = a
d.v = a
d.s = c
assert l.w.t.w.u.r.z.x.txt == "a"