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

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

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

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

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

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

d.s = g
b.p = h
b.r = h
b.y = i
b.t = i
h.v = d
i.y = b
i.o = f
i.z = f
i.r = e
i.u = n
n.q = i
m.p = h
m.r = h
m.y = i
m.t = i
e.s = n
g.q = i
f.q = i
assert h.v.s.q.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

d.s = g
b.p = h
b.r = h
b.y = i
b.t = i
h.v = d
i.y = b
i.o = f
i.z = f
i.r = e
i.u = n
n.q = i
m.p = h
m.r = h
m.y = i
m.t = i
e.s = n
g.q = i
f.q = i
assert h.v.s.q.u.q.txt == "i"