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

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

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

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

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

d = A("d")
g = B("g")
b = C("b")
n = D("n")
i = E("i")
j = E("j")
m = E("m")
h = E("h")
e = E("e")

d.x = b
d.v = n
d.o = g
g.u = d
g.w = e
b.x = g
b.t = n
n.u = g
n.s = d
n.y = b
i.p = g
i.u = h
j.p = g
j.u = e
m.p = g
m.u = i
h.p = g
h.u = m
e.p = g
e.u = m
assert n.u.u.x.t.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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

d = A("d")
g = B("g")
b = C("b")
n = D("n")
i = E("i")
j = E("j")
m = E("m")
h = E("h")
e = E("e")

d.x = b
d.v = n
d.o = g
g.u = d
g.w = e
b.x = g
b.t = n
n.u = g
n.s = d
n.y = b
i.p = g
i.u = h
j.p = g
j.u = e
m.p = g
m.u = i
h.p = g
h.u = m
e.p = g
e.u = m
assert n.u.u.x.t.y.t.txt == "n"