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

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

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

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

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

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

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

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

a.t = e
a.z = e
a.s = e
a.w = c
a.p = n
c.r = f
c.w = a
c.v = d
c.q = l
f.p = a
f.y = d
f.r = d
f.u = n
d.w = e
n.t = a
n.w = a
n.s = d
n.v = f
n.p = l
l.w = n
l.v = a
l.u = a
l.s = f
l.x = f
l.t = d
l.p = e
e.u = d
e.y = d
assert l.t.w.u.w.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: G = None
        self.w: B = None
        self.s: G = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

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

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