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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.p: E = None
        self.r: E = None
        self.t: C = None
        self.txt = txt

h = A("h")
f = B("f")
g = C("g")
d = D("d")
e = E("e")
i = E("i")
l = D("l")

h.o = l
h.s = f
f.q = d
g.w = h
g.v = e
g.p = d
d.q = l
d.w = l
d.o = g
d.x = f
d.p = e
e.x = f
e.q = f
e.p = i
e.r = i
e.t = g
i.x = f
i.q = f
i.p = e
i.r = e
i.t = g
l.q = d
l.w = d
l.o = g
l.x = f
l.p = i
assert f.q.w.w.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.p: E = None
        self.r: E = None
        self.t: C = None
        self.txt = txt

h = A("h")
f = B("f")
g = C("g")
d = D("d")
e = E("e")
i = E("i")
l = D("l")

h.o = l
h.s = f
f.q = d
g.w = h
g.v = e
g.p = d
d.q = l
d.w = l
d.o = g
d.x = f
d.p = e
e.x = f
e.q = f
e.p = i
e.r = i
e.t = g
i.x = f
i.q = f
i.p = e
i.r = e
i.t = g
l.q = d
l.w = d
l.o = g
l.x = f
l.p = i
assert f.q.w.w.x.q.txt == "d"