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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: A = None
        self.x: E = None
        self.t: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: A = None
        self.x: E = None
        self.t: D = None
        self.o: D = None
        self.txt = txt

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

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

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

g.s = a
e.w = m
e.r = m
e.s = l
e.x = d
i.x = d
i.p = e
m.v = e
m.w = g
m.x = d
m.t = l
m.o = l
d.p = e
d.t = i
c.v = i
c.p = a
c.w = l
c.s = d
l.v = e
l.w = a
l.x = d
l.t = m
l.o = m
a.s = g
assert e.r.v.s.v.s.x.p.s.txt == "l"