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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.s: D = None
        self.z: D = None
        self.w: E = None
        self.txt = txt

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

m.r = g
m.w = h
k.t = g
n.u = m
n.t = g
n.s = g
n.x = h
e.v = g
e.r = g
e.x = n
e.y = n
e.u = k
b.v = h
b.w = h
b.y = k
b.s = e
b.z = e
j.r = e
j.w = h
i.t = g
h.v = b
h.w = b
h.y = k
h.s = g
h.z = e
g.v = e
g.r = e
g.x = n
g.y = n
g.u = k
assert b.v.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.s: D = None
        self.z: D = None
        self.w: E = None
        self.txt = txt

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

m.r = g
m.w = h
k.t = g
n.u = m
n.t = g
n.s = g
n.x = h
e.v = g
e.r = g
e.x = n
e.y = n
e.u = k
b.v = h
b.w = h
b.y = k
b.s = e
b.z = e
j.r = e
j.w = h
i.t = g
h.v = b
h.w = b
h.y = k
h.s = g
h.z = e
g.v = e
g.r = e
g.x = n
g.y = n
g.u = k
assert b.v.z.v.txt == "g"