class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

f = A("f")
i = B("i")
d = C("d")
k = D("k")
n = E("n")
c = D("c")
h = E("h")
l = C("l")

f.y = n
f.q = d
i.r = h
d.v = n
d.r = n
d.t = n
d.q = c
k.t = i
k.q = i
k.s = h
n.t = h
n.x = i
c.t = i
c.q = i
c.s = n
h.t = n
h.x = i
l.v = n
l.r = n
l.q = c
l.t = h
assert i.r.t.t.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

f = A("f")
i = B("i")
d = C("d")
k = D("k")
n = E("n")
c = D("c")
h = E("h")
l = C("l")

f.y = n
f.q = d
i.r = h
d.v = n
d.r = n
d.t = n
d.q = c
k.t = i
k.q = i
k.s = h
n.t = h
n.x = i
c.t = i
c.q = i
c.s = n
h.t = n
h.x = i
l.v = n
l.r = n
l.q = c
l.t = h
assert i.r.t.t.t.x.txt == "i"