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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: A = None
        self.s: E = None
        self.y: E = 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.s: E = None
        self.q: A = None
        self.p: C = None
        self.x: E = None
        self.u: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: A = None
        self.s: E = None
        self.y: E = 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.s: E = None
        self.q: A = None
        self.p: C = None
        self.x: E = None
        self.u: B = None
        self.txt = txt

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

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

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