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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: F = None
        self.p: D = None
        self.x: D = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: E = None
        self.s: B = None
        self.o: F = None
        self.v: B = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

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

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

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

k = A("k")
a = B("a")
d = C("d")
h = D("h")
i = E("i")
j = F("j")
f = G("f")

k.q = h
a.w = j
a.o = j
a.p = h
a.x = h
a.t = d
d.q = j
d.o = k
d.z = i
h.t = k
h.z = k
h.q = i
h.s = a
h.v = a
h.u = a
h.o = j
i.u = h
i.p = k
i.x = j
j.x = i
j.z = a
j.s = k
j.r = k
j.t = f
j.q = f
j.w = d
f.y = a
f.q = a
f.p = a
f.z = i
f.s = i
assert h.o.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: F = None
        self.p: D = None
        self.x: D = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: E = None
        self.s: B = None
        self.o: F = None
        self.v: B = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

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

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

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

k = A("k")
a = B("a")
d = C("d")
h = D("h")
i = E("i")
j = F("j")
f = G("f")

k.q = h
a.w = j
a.o = j
a.p = h
a.x = h
a.t = d
d.q = j
d.o = k
d.z = i
h.t = k
h.z = k
h.q = i
h.s = a
h.v = a
h.u = a
h.o = j
i.u = h
i.p = k
i.x = j
j.x = i
j.z = a
j.s = k
j.r = k
j.t = f
j.q = f
j.w = d
f.y = a
f.q = a
f.p = a
f.z = i
f.s = i
assert h.o.z.t.txt == "d"