class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: B = None
        self.z: D = None
        self.t: C = None
        self.u: E = None
        self.p: D = None
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: F = None
        self.x: C = None
        self.z: B = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: F = None
        self.x: C = None
        self.z: B = None
        self.v: F = None
        self.txt = txt

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

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

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

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