class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: B = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: A = None
        self.z: D = None
        self.txt = txt

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

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

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

n = A("n")
c = B("c")
h = C("h")
a = D("a")
g = E("g")
k = C("k")
e = D("e")

n.o = k
n.z = c
n.v = c
c.w = n
c.t = n
c.z = a
h.o = e
h.r = n
a.s = e
g.x = h
k.o = a
k.r = n
e.s = a
assert g.x.r.o.o.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: B = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: A = None
        self.z: D = None
        self.txt = txt

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

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

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

n = A("n")
c = B("c")
h = C("h")
a = D("a")
g = E("g")
k = C("k")
e = D("e")

n.o = k
n.z = c
n.v = c
c.w = n
c.t = n
c.z = a
h.o = e
h.r = n
a.s = e
g.x = h
k.o = a
k.r = n
e.s = a
assert g.x.r.o.o.s.s.s.txt == "e"