class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.z: E = None
        self.x: E = None
        self.o: A = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: E = None
        self.z: A = None
        self.v: D = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.z: E = None
        self.x: E = None
        self.o: A = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: E = None
        self.z: A = None
        self.v: D = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

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

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