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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: E = None
        self.v: E = None
        self.q: G = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.txt = txt

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

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

i.z = f
e.x = l
l.y = d
l.z = d
l.w = e
f.z = b
f.q = b
f.y = d
f.v = d
f.o = i
d.v = i
d.r = c
d.x = b
c.q = b
c.x = f
b.q = e
b.v = e
b.u = i
b.r = i
b.z = d
b.y = l
assert l.w.x.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: E = None
        self.v: E = None
        self.q: G = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.txt = txt

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

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

i.z = f
e.x = l
l.y = d
l.z = d
l.w = e
f.z = b
f.q = b
f.y = d
f.v = d
f.o = i
d.v = i
d.r = c
d.x = b
c.q = b
c.x = f
b.q = e
b.v = e
b.u = i
b.r = i
b.z = d
b.y = l
assert l.w.x.w.x.txt == "l"