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

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

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

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

e = A("e")
h = B("h")
c = C("c")
j = D("j")
f = A("f")
b = A("b")
d = C("d")
l = A("l")
i = C("i")

e.s = j
e.o = j
h.z = j
h.r = d
c.p = j
c.s = l
c.w = h
c.q = e
j.r = i
j.w = d
j.u = l
f.s = j
f.o = j
b.s = j
b.o = j
d.p = j
d.s = e
d.q = e
d.w = h
l.s = j
l.o = j
i.p = j
i.s = f
i.w = h
i.q = b
assert e.s.u.o.w.s.s.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: D = None
        self.txt = txt

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

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

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

e = A("e")
h = B("h")
c = C("c")
j = D("j")
f = A("f")
b = A("b")
d = C("d")
l = A("l")
i = C("i")

e.s = j
e.o = j
h.z = j
h.r = d
c.p = j
c.s = l
c.w = h
c.q = e
j.r = i
j.w = d
j.u = l
f.s = j
f.o = j
b.s = j
b.o = j
d.p = j
d.s = e
d.q = e
d.w = h
l.s = j
l.o = j
i.p = j
i.s = f
i.w = h
i.q = b
assert e.s.u.o.w.s.s.r.q.txt == "b"