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

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

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

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

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

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

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

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

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

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

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

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

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