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

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

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

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

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

d = A("d")
k = B("k")
h = C("h")
i = D("i")
n = E("n")
g = B("g")

d.p = h
d.y = n
k.x = g
k.w = g
k.t = g
h.v = d
h.y = d
i.u = n
n.y = h
g.x = k
g.w = k
g.t = k
assert n.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.txt = txt

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

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

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

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

d = A("d")
k = B("k")
h = C("h")
i = D("i")
n = E("n")
g = B("g")

d.p = h
d.y = n
k.x = g
k.w = g
k.t = g
h.v = d
h.y = d
i.u = n
n.y = h
g.x = k
g.w = k
g.t = k
assert n.y.y.y.y.txt == "h"