class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: C = None
        self.r: F = None
        self.q: G = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.v: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: F = None
        self.q: A = None
        self.r: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.v: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: F = None
        self.q: A = None
        self.r: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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