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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.v: C = None
        self.w: C = None
        self.x: A = None
        self.s: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: C = None
        self.p: C = None
        self.w: B = None
        self.txt = txt

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

l = A("l")
i = B("i")
g = C("g")
b = D("b")
e = E("e")
d = F("d")
f = A("f")
m = F("m")
a = A("a")

l.y = i
i.p = b
i.z = m
i.s = m
i.v = g
i.w = g
i.x = f
g.w = m
g.p = d
b.p = m
b.r = a
e.t = g
e.s = g
e.p = g
e.w = i
d.s = i
d.r = e
d.x = e
f.y = i
m.s = i
m.r = e
m.x = e
a.y = i
assert a.y.x.y.p.p.s.p.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.v: C = None
        self.w: C = None
        self.x: A = None
        self.s: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: C = None
        self.p: C = None
        self.w: B = None
        self.txt = txt

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

l = A("l")
i = B("i")
g = C("g")
b = D("b")
e = E("e")
d = F("d")
f = A("f")
m = F("m")
a = A("a")

l.y = i
i.p = b
i.z = m
i.s = m
i.v = g
i.w = g
i.x = f
g.w = m
g.p = d
b.p = m
b.r = a
e.t = g
e.s = g
e.p = g
e.w = i
d.s = i
d.r = e
d.x = e
f.y = i
m.s = i
m.r = e
m.x = e
a.y = i
assert a.y.x.y.p.p.s.p.p.s.txt == "i"