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

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

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

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

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

e = A("e")
b = B("b")
g = C("g")
a = D("a")
f = E("f")
l = A("l")
h = E("h")
i = C("i")
c = D("c")

e.y = c
e.x = c
e.s = h
e.v = h
e.w = i
b.q = h
b.p = e
g.s = l
a.y = g
a.q = g
a.x = h
f.p = e
f.y = h
l.y = c
l.x = c
l.s = h
l.w = i
l.v = f
h.p = l
h.y = f
i.s = l
c.y = i
c.q = g
c.x = h
assert b.p.w.s.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: D = None
        self.s: E = None
        self.w: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

e = A("e")
b = B("b")
g = C("g")
a = D("a")
f = E("f")
l = A("l")
h = E("h")
i = C("i")
c = D("c")

e.y = c
e.x = c
e.s = h
e.v = h
e.w = i
b.q = h
b.p = e
g.s = l
a.y = g
a.q = g
a.x = h
f.p = e
f.y = h
l.y = c
l.x = c
l.s = h
l.w = i
l.v = f
h.p = l
h.y = f
i.s = l
c.y = i
c.q = g
c.x = h
assert b.p.w.s.s.p.txt == "l"