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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: A = None
        self.x: C = None
        self.u: B = None
        self.q: F = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

e = A("e")
l = B("l")
h = C("h")
g = D("g")
m = E("m")
c = F("c")
d = E("d")
n = A("n")

e.v = g
e.u = l
e.r = h
e.w = h
e.x = d
l.u = h
h.w = c
h.v = c
g.z = e
g.r = n
g.x = h
g.p = h
g.u = l
g.q = c
m.y = g
m.q = h
m.x = l
m.t = c
c.v = g
d.y = g
d.q = h
d.x = l
d.t = c
n.v = g
n.u = l
n.r = h
n.w = h
n.x = m
assert n.u.u.v.v.u.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: B = None
        self.r: C = None
        self.w: C = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: A = None
        self.x: C = None
        self.u: B = None
        self.q: F = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

e = A("e")
l = B("l")
h = C("h")
g = D("g")
m = E("m")
c = F("c")
d = E("d")
n = A("n")

e.v = g
e.u = l
e.r = h
e.w = h
e.x = d
l.u = h
h.w = c
h.v = c
g.z = e
g.r = n
g.x = h
g.p = h
g.u = l
g.q = c
m.y = g
m.q = h
m.x = l
m.t = c
c.v = g
d.y = g
d.q = h
d.x = l
d.t = c
n.v = g
n.u = l
n.r = h
n.w = h
n.x = m
assert n.u.u.v.v.u.u.w.txt == "c"