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

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

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

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

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

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

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

l = A("l")
f = B("f")
e = C("e")
n = D("n")
a = E("a")
m = F("m")
j = G("j")

l.s = n
l.z = n
l.x = n
l.q = f
f.y = a
f.w = l
f.q = e
e.z = n
n.p = l
n.u = e
n.s = e
a.z = n
m.w = e
m.q = l
j.o = f
j.w = f
j.x = a
j.r = a
j.s = l
j.q = n
assert a.z.p.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: D = None
        self.x: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

l = A("l")
f = B("f")
e = C("e")
n = D("n")
a = E("a")
m = F("m")
j = G("j")

l.s = n
l.z = n
l.x = n
l.q = f
f.y = a
f.w = l
f.q = e
e.z = n
n.p = l
n.u = e
n.s = e
a.z = n
m.w = e
m.q = l
j.o = f
j.w = f
j.x = a
j.r = a
j.s = l
j.q = n
assert a.z.p.q.y.txt == "a"