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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.s: D = None
        self.q: A = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.s: D = None
        self.q: A = None
        self.v: B = None
        self.txt = txt

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

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