class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: C = None
        self.w: F = None
        self.q: C = None
        self.t: G = 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.r: G = None
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: G = None
        self.y: C = None
        self.x: C = None
        self.u: G = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
e = C("e")
b = D("b")
c = E("c")
f = F("f")
i = G("i")

k.z = l
k.s = e
k.q = e
k.w = f
k.t = i
l.y = c
e.r = i
e.s = f
b.y = c
c.w = k
c.r = i
c.u = i
c.y = e
c.x = e
f.r = c
f.p = k
i.w = c
i.p = e
i.y = e
i.q = l
i.x = f
assert e.s.p.w.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: C = None
        self.w: F = None
        self.q: C = None
        self.t: G = 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.r: G = None
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: G = None
        self.y: C = None
        self.x: C = None
        self.u: G = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
e = C("e")
b = D("b")
c = E("c")
f = F("f")
i = G("i")

k.z = l
k.s = e
k.q = e
k.w = f
k.t = i
l.y = c
e.r = i
e.s = f
b.y = c
c.w = k
c.r = i
c.u = i
c.y = e
c.x = e
f.r = c
f.p = k
i.w = c
i.p = e
i.y = e
i.q = l
i.x = f
assert e.s.p.w.r.w.txt == "k"