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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

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

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