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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: A = None
        self.s: C = None
        self.y: F = None
        self.q: B = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: A = None
        self.s: C = None
        self.y: F = None
        self.q: B = None
        self.v: D = None
        self.txt = txt

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

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