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

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

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

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

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

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

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

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

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

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

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

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

f.r = b
d.u = c
c.o = a
c.r = a
c.x = h
c.s = h
c.z = l
l.x = c
l.y = d
a.p = h
a.z = l
e.x = c
e.y = d
b.x = c
b.y = h
h.u = c
i.x = c
i.y = h
assert d.u.o.z.x.r.txt == "a"