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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: E = None
        self.s: C = None
        self.t: A = None
        self.txt = txt

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

l = A("l")
h = B("h")
f = C("f")
j = D("j")
d = E("d")
n = B("n")
b = C("b")
k = A("k")
g = E("g")
e = A("e")

l.w = k
h.z = f
h.p = d
f.r = j
f.x = j
f.y = n
j.x = b
j.s = b
j.o = d
j.t = k
d.p = h
d.v = j
d.o = g
d.x = k
d.z = f
n.z = b
n.p = d
b.r = j
b.x = j
b.y = n
k.w = e
g.p = n
g.v = j
g.o = d
g.x = l
g.z = f
e.w = l
assert b.y.z.x.s.x.t.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: E = None
        self.s: C = None
        self.t: A = None
        self.txt = txt

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

l = A("l")
h = B("h")
f = C("f")
j = D("j")
d = E("d")
n = B("n")
b = C("b")
k = A("k")
g = E("g")
e = A("e")

l.w = k
h.z = f
h.p = d
f.r = j
f.x = j
f.y = n
j.x = b
j.s = b
j.o = d
j.t = k
d.p = h
d.v = j
d.o = g
d.x = k
d.z = f
n.z = b
n.p = d
b.r = j
b.x = j
b.y = n
k.w = e
g.p = n
g.v = j
g.o = d
g.x = l
g.z = f
e.w = l
assert b.y.z.x.s.x.t.w.w.w.w.txt == "e"