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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: G = None
        self.v: G = None
        self.x: F = None
        self.y: G = None
        self.z: C = None
        self.p: F = None
        self.txt = txt

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

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

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

d = A("d")
g = B("g")
k = C("k")
h = D("h")
i = E("i")
b = F("b")
e = G("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: G = None
        self.v: G = None
        self.x: F = None
        self.y: G = None
        self.z: C = None
        self.p: F = None
        self.txt = txt

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

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

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

d = A("d")
g = B("g")
k = C("k")
h = D("h")
i = E("i")
b = F("b")
e = G("e")

d.q = b
d.t = b
d.w = i
g.w = e
g.y = k
k.r = g
k.q = e
k.x = e
k.y = b
k.s = i
h.u = d
h.o = e
h.v = e
h.y = e
h.x = b
h.p = b
h.z = k
i.t = g
i.y = d
i.u = b
b.r = g
b.y = g
b.s = d
b.w = d
e.y = i
e.o = i
e.v = i
e.q = b
e.x = b
e.p = k
assert k.q.q.y.txt == "g"