class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: D = None
        self.q: B = None
        self.z: D = None
        self.u: G = None
        self.r: G = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: G = None
        self.y: E = None
        self.z: G = None
        self.u: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: D = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: G = None
        self.y: E = None
        self.z: G = None
        self.u: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: D = None
        self.r: C = None
        self.txt = txt

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

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

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

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