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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: C = None
        self.o: D = None
        self.w: E = None
        self.txt = txt

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

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

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

h.q = k
h.z = i
h.o = e
h.v = g
h.y = l
i.o = g
f.t = k
f.o = k
f.y = j
f.w = e
k.s = f
k.t = g
k.o = e
l.w = h
l.s = e
l.q = i
j.t = k
j.o = k
j.y = b
j.w = e
g.o = i
b.t = k
b.o = k
b.y = j
b.w = e
e.w = h
e.s = l
e.q = g
assert j.t.s.o.o.s.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: B = None
        self.o: E = None
        self.v: B = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: C = None
        self.o: D = None
        self.w: E = None
        self.txt = txt

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

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

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

h.q = k
h.z = i
h.o = e
h.v = g
h.y = l
i.o = g
f.t = k
f.o = k
f.y = j
f.w = e
k.s = f
k.t = g
k.o = e
l.w = h
l.s = e
l.q = i
j.t = k
j.o = k
j.y = b
j.w = e
g.o = i
b.t = k
b.o = k
b.y = j
b.w = e
e.w = h
e.s = l
e.q = g
assert j.t.s.o.o.s.q.o.txt == "g"