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

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

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

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

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

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

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

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

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

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

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

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

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