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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: E = None
        self.r: G = None
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: A = None
        self.y: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: B = None
        self.s: G = None
        self.z: G = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: E = None
        self.r: G = None
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: A = None
        self.y: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: B = None
        self.s: G = None
        self.z: G = None
        self.q: B = None
        self.txt = txt

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

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

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

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