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

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

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

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

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

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

n.w = f
n.t = c
n.u = c
c.x = h
c.r = f
c.t = f
k.o = c
k.v = c
k.t = n
k.r = h
k.y = f
f.y = h
f.r = k
f.o = k
f.t = n
h.y = c
assert c.x.y.x.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

n.w = f
n.t = c
n.u = c
c.x = h
c.r = f
c.t = f
k.o = c
k.v = c
k.t = n
k.r = h
k.y = f
f.y = h
f.r = k
f.o = k
f.t = n
h.y = c
assert c.x.y.x.y.x.txt == "h"