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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.w: A = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: D = None
        self.q: D = None
        self.t: C = None
        self.r: B = None
        self.x: D = None
        self.y: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.w: A = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: D = None
        self.q: D = None
        self.t: C = None
        self.r: B = None
        self.x: D = None
        self.y: D = None
        self.txt = txt

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

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