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

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

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

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

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

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

e.s = h
e.z = n
j.x = f
c.p = e
c.y = j
a.z = h
a.s = e
a.p = e
a.r = j
a.t = c
h.r = g
g.r = h
i.z = b
i.s = e
i.p = e
i.r = j
i.t = c
f.x = j
n.p = e
n.y = j
b.r = g
assert c.y.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

e.s = h
e.z = n
j.x = f
c.p = e
c.y = j
a.z = h
a.s = e
a.p = e
a.r = j
a.t = c
h.r = g
g.r = h
i.z = b
i.s = e
i.p = e
i.r = j
i.t = c
f.x = j
n.p = e
n.y = j
b.r = g
assert c.y.x.x.x.x.txt == "j"