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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: C = None
        self.q: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: C = None
        self.q: C = None
        self.y: B = None
        self.txt = txt

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

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