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

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.x: D = None
        self.s: E = None
        self.p: D = None
        self.txt = txt

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

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

i.v = d
i.q = a
i.s = h
i.t = f
f.w = a
a.y = f
c.w = d
c.x = d
c.p = d
c.t = a
c.s = h
h.v = d
h.r = f
h.o = f
h.t = a
d.w = c
d.x = c
d.p = c
d.t = a
d.s = h
assert c.x.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: C = None
        self.s: E = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.x: D = None
        self.s: E = None
        self.p: D = None
        self.txt = txt

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

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

i.v = d
i.q = a
i.s = h
i.t = f
f.w = a
a.y = f
c.w = d
c.x = d
c.p = d
c.t = a
c.s = h
h.v = d
h.r = f
h.o = f
h.t = a
d.w = c
d.x = c
d.p = c
d.t = a
d.s = h
assert c.x.t.y.txt == "f"