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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: B = None
        self.t: E = None
        self.w: D = None
        self.txt = txt

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

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

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

g = A("g")
f = B("f")
j = C("j")
h = D("h")
b = E("b")
i = A("i")
a = D("a")
n = C("n")
m = B("m")
e = D("e")

g.w = n
f.o = i
f.u = m
f.t = b
f.w = e
j.w = h
j.x = g
j.p = b
j.y = b
h.u = b
h.y = a
h.s = i
b.t = i
i.w = j
a.u = b
a.y = h
a.s = i
n.w = e
n.x = g
n.p = b
n.y = b
m.o = g
m.u = f
m.t = b
m.w = e
e.u = b
e.y = a
e.s = i
assert j.x.w.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: B = None
        self.t: E = None
        self.w: D = None
        self.txt = txt

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

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

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

g = A("g")
f = B("f")
j = C("j")
h = D("h")
b = E("b")
i = A("i")
a = D("a")
n = C("n")
m = B("m")
e = D("e")

g.w = n
f.o = i
f.u = m
f.t = b
f.w = e
j.w = h
j.x = g
j.p = b
j.y = b
h.u = b
h.y = a
h.s = i
b.t = i
i.w = j
a.u = b
a.y = h
a.s = i
n.w = e
n.x = g
n.p = b
n.y = b
m.o = g
m.u = f
m.t = b
m.w = e
e.u = b
e.y = a
e.s = i
assert j.x.w.w.s.txt == "i"