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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

f.q = l
f.r = l
f.w = l
f.p = c
c.u = e
c.o = l
c.v = n
n.r = l
n.w = l
n.v = f
n.x = h
n.s = h
l.s = e
g.v = l
g.y = l
g.z = l
i.q = l
i.r = l
i.w = l
i.p = c
e.v = l
e.y = l
e.z = l
h.r = l
h.w = l
h.v = i
h.x = n
h.s = n
assert f.w.s.v.s.txt == "e"