class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: C = None
        self.q: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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

i = A("i")
k = B("k")
f = C("f")
e = D("e")
h = E("h")
j = E("j")
a = D("a")
m = E("m")
c = B("c")
n = B("n")

i.s = e
i.q = e
i.r = f
i.x = k
k.r = f
k.s = j
f.u = n
e.p = f
e.v = k
e.y = j
e.w = c
h.s = c
j.s = c
a.p = f
a.v = k
a.y = m
a.w = c
m.s = c
c.r = f
c.s = m
n.r = f
n.s = j
assert i.x.s.s.r.u.s.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: C = None
        self.q: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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

i = A("i")
k = B("k")
f = C("f")
e = D("e")
h = E("h")
j = E("j")
a = D("a")
m = E("m")
c = B("c")
n = B("n")

i.s = e
i.q = e
i.r = f
i.x = k
k.r = f
k.s = j
f.u = n
e.p = f
e.v = k
e.y = j
e.w = c
h.s = c
j.s = c
a.p = f
a.v = k
a.y = m
a.w = c
m.s = c
c.r = f
c.s = m
n.r = f
n.s = j
assert i.x.s.s.r.u.s.s.r.txt == "f"